package org.mm.frame.jqgrid;

import java.io.Serializable;
import java.util.List;

/**
 * A POJO representing a jQgrid's jsonReader property. 
 * @see <a href="http://www.trirand.com/jqgridwiki/doku.php?id=wiki:retrieving_data#json_data">JSON Data</a>
 */
public class JQGridResponse<T extends Serializable> {

	/**
	 * Current page
	 */
	private int page;
	
	/**
	 * Total pages
	 */
	private int total;
	
	/**
	 * Total number of records
	 */
	private long records;
	
	/**
	 * Contains the actual data
	 */
	private List<T> rows;

	public JQGridResponse() {}

	/**
	 * getPage
	 * @return page
	 */
	public int getPage() {
		return page;
	}

	/**
	 * setPage
	 * @param page
	 */
	public void setPage(int page) {
		this.page = page;
	}


	/**
	 * getTotal
	 * @return total
	 */
	public int getTotal() {
		return total;
	}

	/**
	 * setTotal
	 * @param total
	 */
	public void setTotal(int total) {
		this.total = total;
	}

	/**
	 * getRecords
	 * @return records
	 */
	public long getRecords() {
		return records;
	}

	/**
	 * setRecords
	 * @param records
	 */
	public void setRecords(long records) {
		this.records = records;
	}

	/**
	 * getRows
	 * @return rows
	 */
	public List<T> getRows() {
		return rows;
	}

	/**
	 * setRows
	 * @param rows
	 */
	public void setRows(List<T> rows) {
		this.rows = rows;
	}

	@Override
	public String toString() {
		return "JqgridResponse [page=" + page + ", total=" + total
				+ ", records=" + records + "]";
	}
}